package com.zhangc.blog.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhangc.blog.admin.entity.UserEntity;

@Mapper
@Repository
public interface UserMapper extends BaseMapper<UserEntity> {
    List<UserEntity> queryAllUsers();

    UserEntity queryUserById(Long id);

    //增加数据
    void insertUser(UserEntity user);

    /**
     * 根据用户名获取用户信息
     */
    List<UserEntity> getUsersByUsername(String username);

    /**
     * 根据id获取其可访问的api列表
     */
    List<String> getApisById(Long id);

    UserEntity findByUsernameOrEmail(String var);
}
